package router

import (
	"cgs-server/server"
	"cgs-server/server/cgs/app/api"
	"cgs-server/server/cgs/app/store/mongo"
)

func initAppRouter() {
	storeIns, _ := mongo.GetMongoFactory()

	handler := api.NewAppHandler(storeIns)

	server.Get("/api/app/detail", handler.Get, "", server.Login)
	server.Post("/api/app/update-group-sort", handler.Update, "", server.Login)
	server.Post("/api/app/update", handler.Update, "", server.Login)
	server.Get("/api/app/export", handler.Export, "", server.None)
	server.Post("/api/app/import", handler.Import, "", server.Login)
}
